package com.example.myapplication.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.widget.Button;

import com.example.myapplication.R;

import org.androidannotations.annotations.EView;

@EView
public class AButton extends Button {

    public AButton(Context context) {
        super(context);
        initButton();
    }
    public AButton(Context context, AttributeSet attrs) {
        super(context, attrs);
        initButton();
    }
    public AButton(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initButton();
    }
    private void initButton() {
        this.setWidth(100);
        this.setHeight(100);
        this.setBackgroundColor(getResources().getColor(R.color.color05));
        this.setText("自定义按钮");
        this.setTextColor(getResources().getColor(R.color.color02));
        this.setGravity(Gravity.CENTER);
    }
}
